import { request } from '@/apis';
import { addPrefix } from '@/utils/helper';

const prefixUrl = '/ep-query';

const Api = {
  /** 热门搜索 */
  hotCompany: '/hotCompany',
  search: '/search'
};

addPrefix(Api, prefixUrl);

/** 获取热门搜索 */
export const getHotCompany = () => request.get({ url: Api.hotCompany }, {
  ignoreCancelToken: false
});

/** 获取搜索结果 */
export interface ISearchParams {
  wd: string | number;
  limit: number;
  offset: number;
}

export const searchCompany = (params: ISearchParams) => request.get({ url: Api.search, params });
